package com.linkhub.oms.data.sync.api.shopify.client;

import com.dtflys.forest.annotation.Get;
import com.dtflys.forest.annotation.Header;
import com.dtflys.forest.annotation.Var;
import com.dtflys.forest.http.ForestResponse;
import com.linkhub.oms.data.sync.api.shopify.domain.response.ShopifyCountResponse;
import com.linkhub.oms.data.sync.api.shopify.domain.response.ShopProductResponse;

import static com.linkhub.oms.common.constant.ShopifyConstant.ACCESS_TOKEN_HEADER;

/**
 * @Description: ProductClient
 * @Author: echo
 * @Date: 2024/3/23 09:10
 * @Version: 1.0
 */
public interface ProductClient {
    @Get("{shop_url}/admin/api/2024-01/products.json?fields={fields}&updated_at_min={updated_at_min}")
    ForestResponse<ShopProductResponse> listAfterUpdateAtShopProducts(@Header(ACCESS_TOKEN_HEADER) String accessToken,
                                                                      @Var("shop_url") String shopUrl,
                                                                      @Var("fields") String fields,
                                                                      @Var("updated_at_min") String updatedAtMin);


    @Get("{shop_url}/admin/api/2024-01/products/count.json?updated_at_min={updated_at_min}")
    ForestResponse<ShopifyCountResponse> getAfterUpdateAtProductCount(@Header(ACCESS_TOKEN_HEADER) String accessToken,
                                                                      @Var("shop_url") String shopUrl,
                                                                      @Var("updated_at_min") String updatedAtMin);

}
